package com.quasar.hpatient.presenter;
import com.quasar.hpatient.model.httpmodel.AnotherDataResult;
import com.quasar.hpatient.model.httpmodel.AnotherResult;
import com.quasar.hpatient.model.httpmodel.DataStateResult;
import com.quasar.hpatient.model.medicalmodel.DoctorListBean;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.onInterface.OnDoctorDetailsListener;

/**
 * author : 许建宏
 * Date: 2017/11/29 0029
 * View:根据环信的id查询医生的个人信息
 */

public class DoctorDetailsPresenter {

    private RequestModel requestModel;
    private OnDoctorDetailsListener testrecordView;

    public DoctorDetailsPresenter(OnDoctorDetailsListener testrecordView) {
        this.requestModel = new RequestModel();
        this.testrecordView = testrecordView;
    }

    public void ChangeBomNameData(String bomName){

        requestModel.User_ChangeBomNameData(bomName, new AnotherResultListener<AnotherDataResult<DoctorListBean>>() {
            @Override
            public void onSuccess(AnotherDataResult<DoctorListBean> data) {
                testrecordView.onSuccess(data);
            }

            @Override
            public void onError(String msg) {
                testrecordView.onError(msg);
            }

            @Override
            public void onRefreshUI() {
                testrecordView.onRefreshUI();
            }
        });
    }

    //转存图片
    public void LXT_AddInspection(String patientid, String inspectionTypeTime, String Cover) {

        requestModel.LXT_AddInspection(patientid, inspectionTypeTime, Cover, new AnotherResultListener<DataStateResult>() {
            @Override
            public void onSuccess(DataStateResult data) {
                testrecordView.onSavePhoto(data);
            }

            @Override
            public void onError(String msg) {
                testrecordView.onError(msg);
            }

            @Override
            public void onRefreshUI() {
                testrecordView.onRefreshUI();
            }
        });

    }
    //根据医生的id查询医生的信息
    public void GetMyPatientInfoList(String doctorId){
        requestModel.GetMyPatientInfoListData(doctorId, new AnotherResultListener<AnotherDataResult<DoctorListBean>>() {
            @Override
            public void onSuccess(AnotherDataResult<DoctorListBean> data) {
                testrecordView.OnselectIdDoctorx(data);
            }

            @Override
            public void onError(String msg) {
                testrecordView.onError(msg);
            }

            @Override
            public void onRefreshUI() {
                testrecordView.onRefreshUI();
            }
        });
    }


}
